package com.asiainfo.iam.controller;


import com.asiainfo.iam.config.Result;
import com.asiainfo.iam.service.SsoService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/api/iam/auth")
@Api(tags = "单点登录API")
public class SsoController {
    @Autowired
    private SsoService ssoService;

    /**
     * 单点登录
     * @param code
     * @param request
     * @return
     */
    @PostMapping("/login")
    public Result login(@RequestParam String code,
                        HttpServletRequest request){
        return ssoService.portalLogin(code, request);
    }

}
